﻿Public Interface IContentRetriver
    ''' <summary>
    ''' return all the contents
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function getAllTheContents() As IEnumerable(Of IContent)

End Interface


''' <summary>
''' anything which can contains content, such as user controls, database, clipboard, memory chaces etc...
''' </summary>
''' <remarks></remarks>
Public Interface IContentContainer
    Inherits ICollection(Of IContent), IContentRetriver

    ''' <summary>
    ''' add the contents to the container
    ''' </summary>
    ''' <remarks></remarks>
    Sub addContents(contents As IEnumerable(Of IContent))

    ''' <summary>
    ''' return the request content if the container have it, or nothing
    ''' </summary>
    ''' <param name="guid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function getContent(Of T As IContent)(guid As Guid) As T

    ''' <summary>
    ''' return all the content of the required type
    ''' </summary>
    ''' <typeparam name="T"></typeparam>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function getAll(Of T As IContent)() As IEnumerable(Of T)


    ''' <summary>
    ''' return all the content of the required type
    ''' </summary>
    ''' <typeparam name="T"></typeparam>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function getAllByFilter(Of T As IContent)(filter As T) As IEnumerable(Of T)


    ''' <summary>
    ''' return all the content of the required type
    ''' </summary>
    ''' <typeparam name="T"></typeparam>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function getLightContentRereferece(Of T As IContent)() As IEnumerable(Of LightContentReferece)


    ''' <summary>
    ''' return true if contains at least one object of give type
    ''' </summary>
    ''' <typeparam name="T"></typeparam>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function containsType(Of T As IContent)() As Boolean

    ''' <summary>
    ''' raised when a content is added, for real
    ''' </summary>
    ''' <param name="content"></param>
    ''' <remarks></remarks>
    Event contentAdded(content As IContent)

    ''' <summary>
    ''' raised when a content is removed
    ''' </summary>
    ''' <param name="content"></param>
    ''' <remarks></remarks>
    Event contentRemoved(content As IContent)


    ''' <summary>
    ''' raised when the container contents have changed
    ''' </summary>
    ''' <remarks></remarks>
    Event contentChanged()

    ''' <summary>
    ''' search the container for contents
    ''' </summary>
    ''' <param name="search_text"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function search(search_text As String) As IEnumerable(Of IContent)

End Interface

